package co.sanduche.teach.service.network;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import co.sanduche.teach.service.TaskExecutorService;

public class NetworkChangeReceiver extends BroadcastReceiver {

	@Override
	public void onReceive(final Context context, final Intent intent) {

		int conn = NetworkUtil.getConnectivityStatus(context);
		String status = NetworkUtil.getConnectivityStatusString(conn);
		String t = System.currentTimeMillis() % 1000 + "-";
		// Toast.makeText(context, t + status, Toast.LENGTH_SHORT).show();

		if (conn == NetworkUtil.TYPE_WIFI)
			context.startService(new Intent(context, TaskExecutorService.class));
	}
}